using UnityEngine;
using System.Collections;

public class B_Creditos : MonoBehaviour
{
    private int Id = 25;

	void Start ()
    {
        this.gameObject.AddComponent("MeshRenderer");
        this.gameObject.AddComponent("MeshFilter");
        this.gameObject.AddComponent("BoxCollider");
        this.gameObject.AddComponent("Rigidbody");
        this.gameObject.GetComponent<Rigidbody>().useGravity = false;

        this.gameObject.GetComponent<BoxCollider>().size = new Vector3(0.7f, 0.24f, 0);
        Mesh mesh = Quad.Create(0.35f, 0.12f);

        this.transform.position = new Vector3(0, -0.8f, -1);

        this.gameObject.GetComponent<MeshFilter>().mesh = mesh;
        this.gameObject.GetComponent<MeshRenderer>().material = AtlasManager.globalMaterial;

        this.gameObject.GetComponent<MeshFilter>().mesh.uv = new Vector2[]
		{
		    new Vector2(AtlasManager.rects[Id].xMin, AtlasManager.rects[Id].yMax),
			new Vector2(AtlasManager.rects[Id].xMax, AtlasManager.rects[Id].yMax),
			new Vector2(AtlasManager.rects[Id].xMax, AtlasManager.rects[Id].yMin),
			new Vector2(AtlasManager.rects[Id].xMin, AtlasManager.rects[Id].yMin)
		};
	}

	void Update ()
    {
	}

    void OnMouseDown()
    {
        Menu.button = 3;
        SceneManager.Change();
    }
}